#include "mutex.hpp"


Mutex mutex;
void* start_routine(void* arg)
{
    LockGuard lg(mutex);
    for(int i = 1;i <= 2;i++)
        std::cout << i << "我是线程:" << gettid() << std::endl;
    return nullptr;
}
int main()
{
    std::vector<pthread_t> arr(2);
    for(auto& e : arr)
        pthread_create(&e,nullptr,start_routine,(void*)0);
    for(auto& e : arr)
        pthread_join(e,nullptr);
    return 0;
}